package com.ln.lnzw.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ln.lnzw.R;
import com.ln.lnzw.bean.ComplainBean;
import com.ln.lnzw.bean.SuggestBean;
import com.ln.lnzw.utils.StringTranslateUtils;

import java.util.List;

/**
 * 作者: wlt
 * 时间:2018-05-07 15:25
 * 类描述:我的投诉列表适配器
 *
 */

public class ComplaintAdapter extends BaseQuickAdapter<ComplainBean.ResultBean.ListBean,BaseViewHolder> {
    private static final int MYLIVE_MODE_CHECK = 0;
    int mEditMode = MYLIVE_MODE_CHECK;
    private ImageView mCheckBox;

    public ComplaintAdapter(int layoutResId, @Nullable List data) {
        super(layoutResId, data);
    }
    @Override
    protected void convert(BaseViewHolder helper, ComplainBean.ResultBean.ListBean item) {
              helper.setText(R.id.tv_name,item.getApplyTitle())
                      .setText(R.id.tv_text1,"编号："+item.getApplySearchNumber())
                      .setText(R.id.tv_text2,"状态："+ StringTranslateUtils.getApplyState(item.getApplyCreateState()));
        if (mEditMode == MYLIVE_MODE_CHECK) {
            helper.getView(R.id.check_box).setVisibility(View.GONE);
        } else {
            helper.getView(R.id.check_box).setVisibility(View.VISIBLE);
//            if (item.isSelect()) {
//                mCheckBox=helper.getView(R.id.check_box);
//                mCheckBox.setImageResource(R.mipmap.icon_checkbox_r_c);
//            } else {
//                mCheckBox=helper.getView(R.id.check_box);
//                mCheckBox.setImageResource(R.mipmap.icon_checkbox_r);
//            }
        }
    }
    public void setEditMode(int editMode) {
        mEditMode = editMode;
        notifyDataSetChanged();
    }



}
